import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBHomePage/YBMapMiShuPage/YBMapMiShuProvider/YBMapMiShuEventBus.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBHomePage/YBMapMiShuPage/YBMapMiShuSubPage/YBMapMiShuHuJiaoBottomPage.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBHomePage/YBMapMiShuPage/YBMapMiShuSubPage/YBMapMishuHuJiaoHeaderPage.dart';


class YBMapMiShuHuJiaoInfoPage extends StatefulWidget {
  @override
  _YBMapMiShuHuJiaoInfoPageState createState() => _YBMapMiShuHuJiaoInfoPageState();
}

class _YBMapMiShuHuJiaoInfoPageState extends State<YBMapMiShuHuJiaoInfoPage> {



  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    eventBus.on<YBMapMiShuEventBus>().listen((event) {
        print('联系人---${event.fullNameStr},${event.numberStr}');
    });

  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Scaffold(
        appBar: AppBar(
          title: Text(
              '呼叫秘书'
          ),
          elevation: 0,
        ),
        body: Container(
          child: Stack(
            children: [
              Container(
                child: AmapView(
                  mapType: MapType.Standard,
                  showZoomControl: true,
                  zoomLevel: 17,
                  maskDelay: Duration(milliseconds: 500),
                  onMapCreated: (controller) async{
                    controller.showMyLocation(MyLocationOption(
                      strokeColor: YBColor.commonThemeColor,
                      strokeWidth: 2,
                      show: true,
                      myLocationType: MyLocationType.Locate,
                    ));

                    // _controller = controller;
                  },
                ),
              ),
              Container(
                child:Column(
                  mainAxisAlignment: MainAxisAlignment.end,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Container(
                      child: Padding(
                        padding:EdgeInsets.only(left: 20,right: 20),
                        child: YBMapMiShuHuJiaoHeaderPage(),
                      ),
                    ),
                    Container(
                      color: YBColor.white,
                      child: YBMapMiShuHuJiaoBottomPage(),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

